﻿using System.Text;

namespace 线程切换
{
    class Program
    {
        static async Task Main(string[] args)
        {
            Console.WriteLine(Thread.CurrentThread.ManagedThreadId);
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < 10000; i++)
            {
                sb.Append(i + "xxxxxxx");
            }
            await File.WriteAllTextAsync(@"d:\test\4.txt", sb.ToString());
            Console.WriteLine(Thread.CurrentThread.ManagedThreadId);
            Console.Read();
        }
    }
}